package com.linkhub.oms.dao.mpservice.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkhub.oms.dao.mapper.BillListEntityMapper;
import com.linkhub.oms.dao.mpservice.IBillListService;
import com.linkhub.oms.entity.BillListEntity;
import com.linkhub.oms.entity.LocalProductEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 *  * <p>
 *  * 账单列表 服务实现类
 *  * </p>
 * @author Jaycle
 * @version 1.0.0
 * @Description billListServiceImpl.java
 * @createTime 2024/06/29 22:18
 */
@Service
public class billListServiceImpl extends ServiceImpl<BillListEntityMapper, BillListEntity> implements IBillListService {
    @Override
    public void deleteByInvoiceId( String invoiceId ) {
        lambdaUpdate()
                .eq(BillListEntity::getInvoiceId, invoiceId)
                .remove();
    }

    @Override
    public BillListEntity getInvoiceRecord( String merchantUserId, String invoiceId ) {
        return lambdaQuery()
                .eq(BillListEntity::getMerchantUserId, merchantUserId)
                .eq(BillListEntity::getInvoiceId, invoiceId)
                .last("LIMIT 1")
                .one();
    }
}
